<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ table_name }}</title>
    <style>
        a {
            text-decoration: none; /* 去掉下划线 */
            color: #0078d4; /* MS blue */
            font-weight: bold; /* 加粗 */
            transition: color 0.2s ease; /* 动效 */
        }
        a:hover {
            color: #005a9e; /* 深一点的蓝色 */
        }
        body {
            font-family: Arial, sans-serif;
            background-color: #f3f3f3;
            margin: 0;
            padding: 20px;
        }
        .container {
            max-width: 800px;
            margin: auto;
            background: #ffffff;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            padding: 20px;
        }
        h2 {
            color: #0078d4; /* MS blue */
        }
        textarea {
            width: 100%;
            height: 100px;
            margin-bottom: 10px;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        button {
            background-color: #0078d4;
            color: white;
            border: none;
            border-radius: 4px;
            padding: 10px 20px;
            cursor: pointer;
            margin-right: 10px; /* Add margin for spacing */
        }
        button:hover {
            background-color: #005a9e;
        }
        .result {
            margin-top: 20px;
            background: #f9f9f9;
            padding: 10px;
            border-radius: 4px;
            border: 1px solid #ddd;
        }
        .table-structure {
            margin-top: 20px;
            border-radius: 4px;
            margin-bottom: 20px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 10px;
        }
        th, td {
            padding: 8px;
            text-align: left;
            border: 1px solid #ddd;
        }
        th {
            background-color: #0078d4;
            color: white;
        }
    </style>
</head>
<body>
    <div class="container">
        <div><a href="/database">回到首页</a></div>
        <h2>{{ table_name }}</h2>

        <!-- Table Structure Display -->
        <div class="table-structure">
            <table>
                <thead>
                    <tr>
                        <th>Column Name</th>
                        <th>Type</th>
                        <th>Nullable</th>
                    </tr>
                </thead>
                <tbody>
                    {% for column in columns %}
                        <tr>
                            <td>{{ column.name }}</td>
                            <td>{{ column.type }}</td>
                            <td>{{ column.nullable | tojson }}</td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</body>
</html>
